package ru.amse.tsyganov.jumleditor.validator;

import java.util.ArrayList;
import java.util.List;

public class ProblemsList {
	
	private final ArrayList<Problem> problems = 
		new ArrayList<Problem>();
		
	public void addProblem(Problem p) {
		problems.add(p);
	}

	public List<Problem> getList() {
		return problems;
	}
	
	public final void addProblemSelectionListener(
			ProblemSelectionListener listener) {
		
		for (Problem p : problems) {
			p.addProblemSelectionListener(listener);
		}
	}
	
	public final void removeProblemSelectionListener(
			ProblemSelectionListener listener) {
		
		for (Problem p : problems) {
			p.removeProblemSelectionListener(listener);
		}
	}
}
